<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script>
        function parse(content) {
            const cnt = content.trim();
            const len = cnt.length;
            let c, s, prev, curF;
            let rvcode = /[\w_$]/;
            let rvar = /^[a-zA-Z_$]/;
            let i = -1;
            let vars = '';
            let exps = '';
            let fts = '';
            let varObj = {};
            let filter = {};
            let inF = false;
            let inS = false;
            let newF = false;
            //
            while( i++ < len ) {
                prev = c;
                c = cnt.charCodeAt(i);
                s = cnt.charAt(i);
                //
                if( (c === 0x27 || c === 0x22) && prev !== 0x5C ) { //0x27:' 0x22:" 0x5C:\
                    inS = !inS;
                }
                else if(!inS && c === 0x7C && prev !== 0x7C && cnt.charCodeAt(i+1) !== 0x7C) { // |
                    newF = inF = true;
                }
                if( inF && (!inS && c===0x20 || i===len ) ) {
                    fts = fts.trim();
                    if( fts.charCodeAt(0) === 0x7C ) {
                        newF = true;
                    }
                    else if( newF ) {
                        filter[ curF = fts ] = [];
                        newF = false;
                    }
                    else {
                        filter[curF].push(fts);
                    }
                    fts = '';
                }
                else if( inF ) {
                    fts += s;
                }
                if( !rvcode.test(s) ) {
                    vars = vars.trim();
                    rvar.test(vars) && !filter[vars] ? varObj[vars] = true : null;
                    vars = '';
                }
                // Variable
                if( !inS ) { vars += s; }
                // Expression
                if( !inF ) { exps += s; }
            }
            let ret = {
                content: exps.trim(),
                vars: varObj,
                filter: filter
            }
            return ret;
        }

        console.log(parse('"Name" + "10" + b.a.c || 10 | "escapse" true_f a8 | lower true a.b.c a[10] | upper true "hello world"'));
        // console.log(parse('Name | u "hello world"'));
        // console.log(parse('a.b.c'));
    </script>
</body>
</html>